home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Dec 89 / 0278-Look but don't touch-Dec89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.0 KB  |  67 lines  |  [TEXT/GEOL]

  1. Item    9012352                         28-Dec-89        15:13
  2.  
  3. From:   D1220                           Vari-Lite, Andy Meldrum,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    Look but don't touch..
  8.  
  9. I have a CD ROM that has raster images on it. These images are rather large 8
  10. bit files (like try 15MB images of Washinton DC... ).
  11.  
  12. I ran into a problem opening the file for display only from the CD ROM.
  13. ( Mac II,6.0.4, QD32, CDROM on Appleshare FileServer with the CDROM 2.0 Init )
  14. On attempting to open the file MAOpenFile would return an error. (-44
  15. actually). The error was returned on the call to PBHOpenDeny, & the result sort
  16. of makes sense. I get the feeling that the parameter block is filled in OK, so
  17. I have added an extra test for a locked volume. Have I got this right, since I
  18. don't see any other way of opening the file ???
  19.  
  20.    BEGIN { MAOpenFile }
  21.    {always open data fork, to establish that the file does exist}
  22.    WITH pb DO
  23.    BEGIN
  24.    ioNamePtr := @name;
  25.    ioVRefnum := volRefnum;
  26.    ioVersNum := 0;
  27.    ioPermssn := dataPerm;
  28.    ioMisc := NIL;
  29.    END;
  30.    TestForError(FillInDirID(@pb));
  31.  
  32.    IF (NOT qNeedsROM128K) & (NOT gConfiguration.hasHFS) THEN
  33.    result := paramErr
  34.    ELSE
  35.    result := PBHOpenDeny(@pb, FALSE);  { Try the shared volume open. }
  36.  
  37. { get error -44, from CD ROM here... }
  38.  
  39. (*
  40. Old Code ...
  41. IF result = paramErr THEN  { Not on a shared volume, try HFS open. }
  42. *)
  43.  
  44. (*
  45. New Code Starts
  46. *)
  47. IF ( result = paramErr ) OR (result = -44) THEN
  48. { Not on a shared volume or a write protected volume, try HFS open. }
  49. (*
  50. New Code Stops
  51. *)
  52.  
  53.    BEGIN
  54.    pb.ioPermssn := BAND(dataPerm, 3);
  55.    result := PBHOpen(@pb, FALSE);
  56.    END;
  57.    TestForError(result);
  58. { More of MAOpenFile follows this }
  59.  
  60. Since I don't have a 15MB Mac right now this program raised the interesting
  61. question of how to spool an (arbitary non QD) image file on a Mac. I have a
  62. rather hacked up scheme at the moment & am wondering if anyone knows of a neat
  63. way to achieve this. Any suggestions gratefully recieved.
  64.  
  65. Andy.
  66.  
  67.